﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Weibo4Sharp.Model;

namespace Weibo4Sharp.Service
{
    public partial class WeiboService
    {
        /// <summary>
        /// List follower ids of a user
        /// </summary>
        /// <param name="userId">user id</param>
        /// <param name="count">count default=500|max=5000</param>
        /// <param name="cursor">cursor</param>
        /// <returns></returns>
        public virtual WeiboCursorList<long> ListFollowerIdsOf(long userId, int count = 500, int cursor = -1)
        {
            return WithHammock<WeiboCursorList<long>>(
                "followers/ids", FormatAsString, 
                "?id=", userId, 
                "&count=", count,
                "&cursor=", cursor);
        }

        /// <summary>
        /// List follower ids of a user
        /// </summary>
        /// <param name="screenName">screenName</param>
        /// <param name="count">count default=500|max=5000</param>
        /// <param name="cursor">cursor</param>
        /// <returns></returns>
        public virtual WeiboCursorList<long> ListFollowerIdsOf(string screenName, int count = 500, int cursor = -1)
        {
            return WithHammock<WeiboCursorList<long>>(
                "followers/ids", FormatAsString, 
                "?screen_name=", screenName, 
                "&count=", count,
                "&cursor=", cursor);
        }

        /// <summary>
        /// List friends ids of a user
        /// </summary>
        /// <param name="userId">user id</param>
        /// <param name="count">count default=500|max=5000</param>
        /// <param name="cursor">cursor</param>
        /// <returns></returns>
        public virtual WeiboCursorList<long> ListFriendIdsOf(long userId, int count = 500, int cursor = -1)
        {
            return WithHammock<WeiboCursorList<long>>(
                "friends/ids", FormatAsString,
                "?id=", userId,
                "&count=", count,
                "&cursor=", cursor);
        }

        /// <summary>
        /// List friends ids of a user
        /// </summary>
        /// <param name="screenName">screenName</param>
        /// <param name="count">count default=500|max=5000</param>
        /// <param name="cursor">cursor</param>
        /// <returns></returns>
        public virtual WeiboCursorList<long> ListFriendIdsOf(string screenName, int count = 500, int cursor = -1)
        {
            return WithHammock<WeiboCursorList<long>>(
                "friends/ids", FormatAsString,
                "?screen_name=", screenName,
                "&count=", count,
                "&cursor=", cursor);
        }  
    }
}
